home *** CD-ROM | disk | FTP | other *** search
- hlsl("
-
- #define NSAMPLES 8
-
- #define BLURSTART 1.0f
- #define BLURWIDTH -0.08f
-
- float4x4 PROJECTION_XFORM;
- float4 SCREEN_PARAMS;
-
- static const float2 Center = { 0.5, 0.5 };
-
- struct VS_OUTPUT
- {
- float4 Position : POSITION;
- float2 TexCoord[NSAMPLES] : TEXCOORD0;
- };
-
- VS_OUTPUT main( float4 Position : POSITION,
- float2 TexCoord: TEXCOORD0 )
- {
- VS_OUTPUT OUT;
-
- OUT.Position = mul( Position, PROJECTION_XFORM );
-
- // generate texcoords for radial blur (scale around center)
- float2 s = TexCoord + SCREEN_PARAMS.xy*0.5;
- for(int i=0; i<NSAMPLES; i++) {
- float scale = BLURSTART + BLURWIDTH*(i/(float) (NSAMPLES-1));
- OUT.TexCoord[i] = (s - Center)*scale + Center;
- }
- return OUT;
- }
-
- ")
-
-
-
-